<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="WHIT">
<span class='line'>  2</span> </span><span class="COMM">/**
<span class='line'>  3</span>  * @fileoverview Calendar localization utils.
<span class='line'>  4</span>  * @link http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml
<span class='line'>  5</span>  * @link https://developers.google.com/closure/compiler/docs/js-for-compiler
<span class='line'>  6</span>  */</span><span class="WHIT">
<span class='line'>  7</span> 
<span class='line'>  8</span> 
<span class='line'>  9</span> 
<span class='line'> 10</span> </span><span class="COMM">/**
<span class='line'> 11</span>  * Constructor of Calendar.
<span class='line'> 12</span>  * @constructor
<span class='line'> 13</span>  */</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="NAME">locale.Calendar</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 15</span> 
<span class='line'> 16</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'> 17</span>    * Gets locale week names.
<span class='line'> 18</span>    * @return {!Array.&lt;string>} Returns week names.
<span class='line'> 19</span>    */</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="WHIT">  </span><span class="NAME">this.getWeekNames</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">getData_</span><span class="PUNC">(</span><span class="STRN">'days'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 23</span> 
<span class='line'> 24</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'> 25</span>    * Gets locale month names.
<span class='line'> 26</span>    * @return {!Array.&lt;string>} Returns month names.
<span class='line'> 27</span>    */</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT">  </span><span class="NAME">this.getMonthNames</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">getData_</span><span class="PUNC">(</span><span class="STRN">'months'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 31</span> 
<span class='line'> 32</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'> 33</span>    * Gets locale month name.
<span class='line'> 34</span>    * @param {Date=} opt_date Optional date object, defaults is current date.
<span class='line'> 35</span>    * @return {string} Returns month name.
<span class='line'> 36</span>    * @see locale.Calendar#getMonthNames
<span class='line'> 37</span>    */</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT">  </span><span class="NAME">this.getMonthName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">opt_date</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT">    </span><span class="NAME">opt_date</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">opt_date</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 40</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">self_.getMonthNames</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NAME">opt_date.getMonth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 41</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 42</span> 
<span class='line'> 43</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'> 44</span>    * Gets month number by month name.
<span class='line'> 45</span>    * @param {string} name The month name.
<span class='line'> 46</span>    * @return {number} Returns month number.
<span class='line'> 47</span>    * @see locale.Calendar#getMonthNames
<span class='line'> 48</span>    */</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT">  </span><span class="NAME">this.getMonthByName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT">    </span><span class="COMM">/** @type {!Array.&lt;string>} */</span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">monthes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self_.getMonthNames</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="COMM">/** @type {number} */</span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">monthes.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">name.substr</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">toLowerCase</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT">          </span><span class="NAME">monthes</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">substr</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">toLowerCase</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 59</span> 
<span class='line'> 60</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'> 61</span>    * Gets locale data by key.
<span class='line'> 62</span>    * @param {string} key Data key.
<span class='line'> 63</span>    * @return {!Array.&lt;string>} Returns locale data.
<span class='line'> 64</span>    * @private
<span class='line'> 65</span>    */</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="WHIT">  </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">getData_</span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">data_</span><span class="PUNC">[</span><span class="NAME">locale_.getLanguage</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT">            </span><span class="NAME">data_</span><span class="PUNC">[</span><span class="NAME">util.Locale.ENGLISH.getLanguage</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 70</span> 
<span class='line'> 71</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'> 72</span>    * The reference to current class instance. Used in private methods.
<span class='line'> 73</span>    * @type {!locale.Calendar}
<span class='line'> 74</span>    * @private
<span class='line'> 75</span>    */</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 77</span> 
<span class='line'> 78</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'> 79</span>    * @type {!util.Locale}
<span class='line'> 80</span>    * @private
<span class='line'> 81</span>    */</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">locale_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">util.Locale.getDefault</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 83</span> 
<span class='line'> 84</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'> 85</span>    * @type {!Object.&lt;string, Object>}
<span class='line'> 86</span>    * @private
<span class='line'> 87</span>    */</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">data_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT">    </span><span class="STRN">'en'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT">      </span><span class="STRN">'days'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">'Su'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Mo'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Tu'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'We'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Th'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Fr'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Sa'</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT">      </span><span class="STRN">'months'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">'January'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'February'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'March'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'April'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'May'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'June'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT">                 </span><span class="STRN">'July'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'August'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'September'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'October'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'November'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT">                 </span><span class="STRN">'December'</span><span class="PUNC">]</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="WHIT">    </span><span class="STRN">'de'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 96</span> </span><span class="WHIT">      </span><span class="STRN">'days'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">'So'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Mo'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Di'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Mi'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Do'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Fr'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Sa'</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="WHIT">      </span><span class="STRN">'months'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">'Januar'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Februar'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'März'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'April'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Mai'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Juni'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="WHIT">                 </span><span class="STRN">'Juli'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'August'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'September'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Oktober'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'November'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="WHIT">                 </span><span class="STRN">'Dezember'</span><span class="PUNC">]</span><span class="WHIT">
<span class='line'>100</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>101</span> </span><span class="WHIT">    </span><span class="STRN">'ru'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT">      </span><span class="STRN">'days'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">'Вс'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Пн'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Вт'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Ср'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Чт'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Пт'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Сб'</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT">      </span><span class="STRN">'months'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">'Январь'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Февраль'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Март'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Апрель'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Май'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Июнь'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>104</span> </span><span class="WHIT">                 </span><span class="STRN">'Июль'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Август'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Сентябрь'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Октябрь'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Ноябрь'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>105</span> </span><span class="WHIT">                 </span><span class="STRN">'Декабрь'</span><span class="PUNC">]</span><span class="WHIT">
<span class='line'>106</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>107</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>108</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>109</span> </span></pre></body></html>